package com.gxar.marketdelivery.infra.dao.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author nice
 * @version 1.0
 * @created 2023/7/23.
 */
@Data
@NoArgsConstructor
@TableName("market_delivery_rule")
public class DeliveryRuleEntity {

    public static final String FIELD_TARGET_ID = "target_id";
    public static final String FIELD_DELIVERY_TARGET = "delivery_target";
    public static final String FIELD_START_TIME = "start_time";
    public static final String FIELD_END_TIME = "end_time";
    public static final String FIELD_PERIOD_TYPE = "period_type";
    public static final String FIELD_PERIOD_INFO = "period_info";
    public static final String FIELD_USER_GROUP = "user_group";
    public static final String FIELD_NEED_LOGIN = "need_login";
    public static final String FIELD_SHOW_WITHOUT_LOGIN = "show_without_login";
    public static final String FIELD_VISIT_MODE = "visit_mode";
    public static final String FIELD_STATUS = "status";
    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private Integer deliveryTarget;

    private Long targetId;
    /**
     * 有效起始时间
     */
    private Date startTime;
    /**
     * 有效结束时间
     */
    private Date endTime;
    /**
     * 展示时间类型
     */
    private Integer periodType;
    /**
     * 展示时间信息
     */
    private String periodInfo;
    /**
     * 用户人群
     */
    private String userGroup;
    /**
     * 是否需要登录(0:不需要,1:需要)
     */
    @TableField("is_need_login")
    private Boolean needLogin;

    /**
     * 是否在未登录情况下展示
     */
    @TableField("is_show_without_login")
    private Boolean showWithoutLogin;

    /**
     * 访问模式
     */
    private String visitMode;

    /**
     * 灰度名单，手机号，逗号分隔
     */
    private String grayList;

    /**
     * 创建时间
     */
    @TableField(value = "gmt_create", fill = FieldFill.INSERT)
    private Date gmtCreate;

    /**
     * 修改时间
     */
    @TableField(value = "gmt_modify", fill = FieldFill.INSERT_UPDATE)
    private Date gmtModify;

    /**
     * 有效状态(0:无效，1:有效)
     */
    private Integer status = 1;
}
